home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / NeXTmj / Source / GameBoardView.m < prev    next >
Text File  |  1991-03-18  |  820b  |  56 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. /*
  5.  *
  6.  $Author$
  7.  $Header$
  8.  *
  9.  $Log$
  10.  */
  11.  
  12.  
  13. #import "GameBoardView.h"
  14. #import    "GameInterface.h"
  15. #import <appkit/graphics.h>
  16. #import    <dpsclient/psops.h>
  17.  
  18. #import    <assert.h>
  19.  
  20.  
  21. @implementation GameBoardView
  22.  
  23.  
  24. - mouseDown:( NXEvent* )theEvent {
  25.  
  26.     NXPoint    clickPoint = theEvent->location;
  27.     
  28.     
  29.     [ self convertPoint:&clickPoint fromView:nil ];
  30.     
  31.     if( theEvent->data.mouse.click == 1 )
  32.         [( GameInterface* )gameInterface click:&clickPoint ];
  33.     
  34.     else
  35.         if( theEvent->data.mouse.click == 2 )
  36.             [( GameInterface* )gameInterface doubleClick:&clickPoint ];
  37.  
  38.     return self;
  39. }
  40.  
  41.  
  42. - drawSelf:(const NXRect *)rects :(int)rectCount {
  43.  
  44.     
  45.     assert( gameInterface );
  46.     
  47.     PSsetgray( NX_WHITE );
  48.     NXRectFillList( rects, rectCount );
  49.     [( GameInterface* )gameInterface gameBoardDraw ];
  50.     
  51.     return self;
  52. }
  53.  
  54.  
  55. @end
  56.